<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>工作流详情</title>
    <%
        /********** 保存网站的基本路径 ***********/
        String path = request.getContextPath();
        String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
                + path + "/";
        //将该路径地址缓存到 session中 ,例如：http://localhost:8090/tjnu_ssh_1128/
        session.setAttribute("mybasePath", basePath);

    %>
    <!-- CSS -->
    <jsp:include page="../include/headtag.jsp" />
    <!-- <link rel="stylesheet"
        href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500"> -->
    <link rel="stylesheet"
          href="${mybasePath}assets/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${mybasePath}assets/css/form-elements.css">
    <link rel="stylesheet" href="${mybasePath}assets/css/style.css">
    <link rel="stylesheet" href="assets/layui/css/layui.css">
</head>
<body>
<jsp:include page="../include/head.jsp" />
<jsp:include page="../include/menu.jsp" />
<div id="page-wrapper" style="margin-top: 50px;">
    <div id="page-inner">
        <div class="row">
            <div class="col-md-12">
                <h3 class="text-left">工作流详情</h3>
            </div>
        </div>
        <hr />
        <table class="table table-striped table-hover text-left">
            <thead>
            <tr>
                <th style="text-align: center;">流程编号</th>
                <th style="text-align: center;">主流程名称</th>
                <th style="text-align: center;">子流程名称</th>
                <th style="text-align: center;">当前状态</th>
                <th style="text-align: center;">操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${lists}" var="mEnum">
                <tr>
                    <td style="text-align: center;">${mEnum.basicEnumerationId}</td>
                    <td style="text-align: center;">${mEnum.details}</td>
                    <td style="text-align: center;">${mEnum.detailsName}</td>
                    <td style="text-align: center;">
                        <c:choose>
                            <c:when test="${mEnum.codeLength==0}">
                                未完成
                            </c:when>
                            <c:otherwise>
                                已完成
                            </c:otherwise>
                        </c:choose>

                    </td>
                    <td>
                        <div class="col-lg-4"></div>
                        <a onclick="updateflow(${code_id},${mEnum.codeCodeId})" class="btn btn-success btn-sm">确认完成</a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>

    </div>

    <!-- /. PAGE INNER  -->
</div>
<!-- /. PAGE WRAPPER  -->

</body>
<!-- Javascript -->
<script src="${mybasePath}assets/bootstrap/js/bootstrap.min.js"></script>
<script src="${mybasePath}assets/bootstrap/js/jquery.min.js"></script>
<script src="${mybasePath}assets/js/jquery.backstretch.min.js"></script>

<script type="text/javascript">
    function updateflow(id,pos,pos_id) {
        window.location.href = "/update?id="+id+"&pos="+pos+"&pos_id="+pos_id;
    }
</script>
</html>